version 17.0
clear all
cd "MYPATH\estimate_w_xs"
adopath + ../ado/

cap log close
pause on

log using master_run.log, replace

preliminaries

foreach PATH in RESULTS TEMP {
	cap mkdir "${`PATH'}\estimate_w_xs"
    if "`PATH'" != "TEMP" cap mkdir "${`PATH'}\estimate_w_xs\figures"
}

graph set window fontface default
graph set ps fontface default
graph set window fontfacemono "Consolas"
graph set ps fontfacemono "Consolas"

global Rterm_path `"C:\Program Files\R\R-3.6.3\bin\x64\Rterm.exe"'
global Rterm_options `"--vanilla"'

cap ssc install rsource

rsource using bootstrap_se.R, maxlines(5000)
rsource using counterfactuals_xs.R, maxlines(5000)
cd "MYPATH\results_exhibits_xs"
rsource using model_comp_stat_xs.R, maxlines(5000)
do cf_figures_xs.do

cd "MYPATH\estimate_w_xs"
do model_fit.do

cd "MYPATH\estimate_w_xs"
rsource using counterfactuals_xs_full.R, maxlines(5000)

cd "MYPATH\estimate_w_xs"
do risk_plots.do
